<template>
    <div class="scheme-production-increase" :key="compSelectorkeys">
        <!-- 新增弹窗 -->
        <a-modal
         class="scheme-modal flow-path-model-box"
         :visible="visibleShow" 
         title='办理'
         :maskClosable="false"
         :closable="false"
         :destroyOnClose="true"
         width="100%"
         wrapClassName="full-modal"
         >
            <div style="height: 100%;background: #fff;">
                <a-spin size="large" :spinning="spinning" :key="spinningKey">
                    <div style="width: 100%; background-color: #fff;position: fixed; top: 0;z-index: 99;padding: 10px;display: flex;">
                        <div>
                            <a-button class="blue-btn" type="primary" @click="returnClick()">返回</a-button>
                            <a-button style="margin-left: 10px;" class="blue-btn" type="primary" @click="refreshClick()">刷新</a-button>
                        </div>
                        <div style="margin-left: 50px;">
                            <a-button class="blue-btn" type="primary" @click="linkHandling('submitFlow')">办理</a-button>
                            <a-button style="margin-left: 10px;" class="blue-btn" type="primary" @click="returnPreviousLink('returnUpperXcjcFlowJob')">退回</a-button>
                            <a-button style="margin-left: 10px;" class="blue-btn" type="primary" @click="rectificationClick('pushQyBcZgNotice')">企业整改</a-button>
                            <a-button style="margin-left: 10px;" class="blue-btn" type="primary" @click="historyListClick('querySqsxBczgjlHistoryList')">企业整改历史记录</a-button>
                        </div>
                    </div>
                    <div style="width: 100%;height: 80px;"></div>
                    <a-tabs v-model:activeKey="matterActiveKey" @change="matterChange" class="matter-handle-tabs">
                        <a-tab-pane key="事项办理" tab="事项办理"></a-tab-pane>
                        <a-tab-pane key="事项信息" tab="事项信息"></a-tab-pane>
                    </a-tabs>
                    <div>
                        <eventSet ref="eventSetRef" v-show="matterActiveKey == '事项信息'" :parameter="parameterData"/>
                    </div>
                    <div v-if="matterActiveKey == '事项办理'">
                        <a-tabs v-model:activeKey="tabsModeValue" tab-position="left" :key="compSelectorkeys" >
                            <a-tab-pane key="技术审评" tab="技术审评" v-if="(addEditParameter.fscms == '技术审评' || addEditParameter.fscms == '技术审评+技术审评') && addEditParameter.fcywczt == '是'">
                                <segmentcomp :flowPathParameter="addEditParameter" @successReturn="successReturn" />
                            </a-tab-pane>
                            <a-tab-pane key="技术审评" tab="技术审评" v-if="(addEditParameter.fscms == '技术审评' || addEditParameter.fscms == '技术审评+技术审评') && addEditParameter.fspwczt  == '是'">
                                <technicalReview :addEdittechnicalReview="addEdittechnicalReview"  @successReturn="successReturn"/>
                            </a-tab-pane>
                            <a-tab-pane key="技术审查" tab="技术审查">
                                <examination :addEdittechnicalReview="addEditParameter"  @successReturn="successReturn"/>
                            </a-tab-pane>
                            <a-tab-pane key="综合结论" tab="综合结论">
                                <div style="margin-top: 20px;"></div>
                                <a-form
                                    ref="form"
                                    layout="inline" 
                                    :form="inspectionReportForm" 
                                    class="label-box-w"
                                >
                                    <a-form-item label="移送函编号" class="segment-long-box">
                                        <a-input style="width: 100% !important;" placeholder="请输入移送函编号" v-model:value="formField.fyshbh"/>
                                        <a-button style="margin-left: 15px;" class="blue-btn" type="primary" @click="getNumber('移送函编号','fyshbh')">获取移送函编号</a-button>
                                    </a-form-item>
                                    <a-form-item class="segment-long-box" >
                                        <a-button style="margin-left: 142px;margin-bottom: 15px;" class="blue-btn" type="primary" @click="getConclusion(['fzhjl'])">获取综合评定报告</a-button>
                                    </a-form-item>
                                    <a-form-item label="综合评定报告" class="segment-long-box" >
                                        <a-textarea
                                            style="width: 100% !important;"
                                            placeholder="请输入综合评定报告" 
                                            :rows="4" 
                                            v-model:value="formField.fzhjl"
                                        />
                                    </a-form-item>
                                    <br/>
                                    <a-form-item label="综合评定结论" class="segment-long-box" >
                                        <compSelector
                                            :key="fzhjgKey"
                                            v-model="formField.fzhjg"
                                            compType="Select"
                                            :defaultValue="formField.fzhjg"
                                            dictionaryType="审评结果"
                                        />
                                    </a-form-item>
                                    <br/>
                                    <a-form-item label="综合报告其他问题" class="segment-long-box" >
                                        <a-input style="width: 100% !important;" placeholder="请输入综合报告其他问题" v-model:value="formField.fzhbgqtwt"/>
                                    </a-form-item>
                                    <a-form-item >
                                        <a-button style="margin-left: 126px;" class="blue-btn" type="primary" @click="segmentSubmitClick(1)">保存</a-button>
                                    </a-form-item>
                                </a-form>
                                <a-collapse v-model:activeKey="collapseActiveKeyArr" class="tabs-collapse-box">
                                    <a-collapse-panel key="1" header="整改通知书">
                                        <a-collapse v-model:activeKey="collapseActiveKeyArr" class="collapse-original">
                                            <a-collapse-panel key="2" header="整改通知书">
                                                <a-form layout="inline" style="margin-bottom:10px">
                                                    <a-form-item >
                                                        <a-button class="blue-btn" type="primary" @click="generateRecord('整改通知书','整改通知书')">生成记录</a-button>
                                                    </a-form-item>
                                                </a-form>
                                                <commpVxeTable
                                                    :key="rectificationProcessRefresh"
                                                    :config="rectificationProcessConfig"
                                                    :columns="rectificationProcessColumns"
                                                    :formItem="[]" 
                                                    :adaptiveHeight="true"
                                                > 
                                                    <template v-slot:fwjccmc_slots="{row}" data-desc="自定操作栏">
                                                        <span>{{ row.fwjxsmc }}{{ row.fwjlx }}</span>
                                                    </template>
                                                    <template v-slot:operation_btn="{row}" data-desc="自定操作栏">
                                                        <a-form layout="inline" class="search-form" >
                                                            <a-form-item class="vxe-table-box-w">
                                                                <a-button class="blue-btn" type="primary" @click="viewClick(row)" >查看</a-button>
                                                            </a-form-item>
                                                            <a-form-item>
                                                                <a-button class="blue-btn dMould-btn" type="primary" @click="producerMould(row,'整改通知书')" >选择模板</a-button>
                                                            </a-form-item>
                                                            <a-form-item v-if="editMode == '服务端模式'">
                                                                <a-button class="blue-btn" type="primary" @click="serverEdit(row)" >编辑</a-button>
                                                            </a-form-item>
                                                            <a-form-item class="vxe-table-box-w" v-if="row.fwjlx !== '.pdf' && editMode == '整改通知书'">
                                                                <a-button class="blue-btn" type="primary" @click="editClick(row,'整改通知书')" >编辑</a-button>
                                                            </a-form-item>
                                                            <a-form-item  v-if="row.fwjlx == '.pdf' && editMode == '客户端模式'">
                                                                <a-button class="blue-btn dMould-btn" type="primary" @click="againEdit(row,'整改通知书')" >重新编辑</a-button>
                                                            </a-form-item>
                                                            
                                                            <a-form-item class="vxe-table-box-w" >
                                                                <a-button class="red-btn" type="primary" @click="deleteClick(row,'整改通知书')" >删除</a-button>
                                                            </a-form-item>
                                                            <a-form-item class="vxe-table-box-w">
                                                                <a-upload style="display: inline-block;" :beforeUpload="segmentBeforeUpload" action="" @change="uploadClick($event,row,'整改通知书')">
                                                                    <a-button class="blue-btn" type="primary">上传</a-button>
                                                                </a-upload>
                                                            </a-form-item>
                                                            <a-form-item class="vxe-table-box-w">
                                                                <a-button class="blue-btn" type="primary" @click="downloadClick(row)" >下载</a-button>
                                                            </a-form-item>
                                                        </a-form>
                                                    </template>
                                                </commpVxeTable> 
                                            </a-collapse-panel>
                                            <a-collapse-panel key="3" header="整改通知流程">
                                                <a-form layout="inline" style="margin-bottom:10px">
                                                    <a-form-item >
                                                        <a-button class="blue-btn" type="primary" @click="generateRecord('生成流程','生成流程')">生成流程</a-button>
                                                    </a-form-item>
                                                </a-form>
                                                <commpVxeTable
                                                    :key="rectificationRefresh"
                                                    ref="headmanVxeTable"
                                                    :config="rectificationConfig" 
                                                    :columns="rectificationcolumnsVxe" 
                                                    :formItem="[]"
                                                    :adaptiveHeight="true"
                                                >
                                                    <template v-slot:name_fslsj="{row}" data-desc="自定操作栏">
                                                        <span>{{ timeProcessing(row.fslsj) }}</span>
                                                    </template>
                                                    <template v-slot:name_fblzt="{row}" data-desc="自定操作栏">
                                                        <span style="color: rgb(211, 51, 51);">{{ row.fblzt }}</span>
                                                    </template>
                                                    
                                                    <template v-slot:name_ffssj="{row}" data-desc="自定操作栏">
                                                        <span>{{ row.ffssj }}</span>
                                                    </template>
                                                    <template v-slot:operation_btn="{row}" data-desc="自定操作栏">
                                                        <a-form layout="inline" class="search-form" >
                                                            <a-form-item v-if="row.fblzt == '待办'">
                                                                <a-button class="blue-btn" type="primary" @click="expertProcessReturn(row)" >退回</a-button>
                                                            </a-form-item>
                                                            <a-form-item v-if="row.fblzt == '待办'">
                                                                <a-button class="blue-btn" type="primary" @click="expertProcesstErmination(row)" >终止</a-button>
                                                            </a-form-item>
                                                        </a-form>
                                                    </template>
                                                </commpVxeTable>
                                            </a-collapse-panel>
                                            <a-collapse-panel key="4" header="整改确认报告书">
                                                <a-form layout="inline" style="margin-bottom:10px">
                                                    <a-form-item >
                                                        <a-button class="blue-btn" type="primary" @click="generateRecord('整改确认报告书','整改确认报告书')">生成记录</a-button>
                                                    </a-form-item>
                                                </a-form>
                                                <commpVxeTable
                                                    :key="REPORTKey"
                                                    :config="REPORTConfig" 
                                                    :columns="REPORTColumns"
                                                    :formItem="[]"
                                                    :adaptiveHeight="true"
                                                > 
                                                    <template v-slot:fwjccmc_slots="{row}" data-desc="自定操作栏">
                                                        <span>{{ row.fwjxsmc }}{{ row.fwjlx }}</span>
                                                    </template>
                                                    <template v-slot:operation_btn="{row}" data-desc="自定操作栏">
                                                        <a-form layout="inline" class="search-form" >
                                                            <a-form-item class="vxe-table-box-w">
                                                                <a-button class="blue-btn" type="primary" @click="viewClick(row)" >查看</a-button>
                                                            </a-form-item>
                                                            <a-form-item>
                                                                <a-button class="blue-btn dMould-btn" type="primary" @click="producerMould(row,'整改确认报告书')" >选择模板</a-button>
                                                            </a-form-item>
                                                            <a-form-item v-if="editMode == '服务端模式'">
                                                                <!-- 服务端编辑 -->
                                                                <a-button class="blue-btn" type="primary" @click="serverEdit(row)" >编辑</a-button>
                                                            </a-form-item>
                                                            <a-form-item class="vxe-table-box-w" v-if="row.fwjlx !== '.pdf' && editMode == '客户端模式'">
                                                                <a-button class="blue-btn" type="primary" @click="editClick(row,'整改确认报告书')" >编辑</a-button>
                                                            </a-form-item>
                                                            <a-form-item  v-if="row.fwjlx == '.pdf' && editMode == '客户端模式'">
                                                                <a-button class="blue-btn dMould-btn" type="primary" @click="againEdit(row,'整改确认报告书')" >重新编辑</a-button>
                                                            </a-form-item>
                                                            
                                                            <a-form-item class="vxe-table-box-w" >
                                                                <a-button class="red-btn" type="primary" @click="deleteClick(row,'整改确认报告书')" >删除</a-button>
                                                            </a-form-item>
                                                            <a-form-item class="vxe-table-box-w">
                                                                <a-upload style="display: inline-block;" :beforeUpload="segmentBeforeUpload" action="" @change="uploadClick($event,row,'整改确认报告书')">
                                                                    <a-button class="blue-btn" type="primary">上传</a-button>
                                                                </a-upload>
                                                            </a-form-item>
                                                            <a-form-item class="vxe-table-box-w">
                                                                <a-button class="blue-btn" type="primary" @click="downloadClick(row)" >下载</a-button>
                                                            </a-form-item>
                                                        </a-form>
                                                    </template>
                                                </commpVxeTable>
                                            </a-collapse-panel>
                                        </a-collapse>
                                    </a-collapse-panel>
                                </a-collapse>
                                <a-collapse v-model:activeKey="collapseActiveKeyArr" class="tabs-collapse-box">
                                    <!-- <a-collapse-panel key="5" header="补充整改通知栏">
                                        <a-form layout="inline" style="margin-bottom:10px" >
                                            <a-form-item >
                                                <a-button class="blue-btn" type="primary" @click="generateRecord('整改通知书','整改通知书')">生成记录</a-button>
                                            </a-form-item>
                                        </a-form>
                                        <commpVxeTable
                                            :key="rectificationNoticeRefresh"
                                            :config="rectificationNoticeConfig" 
                                            :columns="rectificationNoticeColumns"
                                            :formItem="[]" 
                                            :adaptiveHeight="true"
                                        > 
                                            <template v-slot:fwjccmc_slots="{row}" data-desc="自定操作栏">
                                                <span>{{ row.fwjxsmc }}{{ row.fwjlx }}</span>
                                            </template>
                                            <template v-slot:operation_btn="{row}" data-desc="自定操作栏">
                                                <a-form layout="inline" class="search-form" >
                                                    <a-form-item class="vxe-table-box-w">
                                                        <a-button class="blue-btn" type="primary" @click="viewClick(row)" >查看</a-button>
                                                    </a-form-item>
                                                    <a-form-item v-if="editMode == '服务端模式'">
                                                        <a-button class="blue-btn" type="primary" @click="serverEdit(row)" >编辑</a-button>
                                                    </a-form-item>
                                                    <a-form-item class="vxe-table-box-w" v-if="row.fwjlx !== '.pdf' && editMode == '客户端模式'">
                                                        <a-button class="blue-btn" type="primary" @click="editClick(row,'整改通知书')" >编辑</a-button>
                                                    </a-form-item>
                                                    <a-form-item v-if="row.fwjlx == '.pdf' && editMode == '客户端模式'">
                                                        <a-button class="blue-btn dMould-btn" type="primary" @click="againEdit(row,'整改通知书')" >重新编辑</a-button>
                                                    </a-form-item>
                                                    <a-form-item class="vxe-table-box-w" >
                                                        <a-button class="red-btn" type="primary" @click="deleteClick(row,'整改通知书')" >删除</a-button>
                                                    </a-form-item>
                                                    <a-form-item class="vxe-table-box-w">
                                                        <a-upload style="display: inline-block;" :beforeUpload="segmentBeforeUpload" action="" @change="uploadClick($event,row,'整改通知书')">
                                                            <a-button class="blue-btn" type="primary">上传</a-button>
                                                        </a-upload>
                                                    </a-form-item>
                                                    <a-form-item class="vxe-table-box-w">
                                                        <a-button class="blue-btn" type="primary" @click="downloadClick(row)" >下载</a-button>
                                                    </a-form-item>
                                                </a-form>
                                            </template>
                                        </commpVxeTable>
                                    </a-collapse-panel> -->
                                    <a-collapse-panel key="6" header="综合评定报告书">
                                        <a-form layout="inline" style="margin-bottom:10px" >
                                            <a-form-item >
                                                <a-button class="blue-btn" type="primary" @click="generateRecord('综合评定报告书','综合评定报告书')">生成记录</a-button>
                                            </a-form-item>
                                        </a-form>
                                        <commpVxeTable
                                            :key="comprehensiveEvaluationRefresh"
                                            :config="comprehensiveEvaluationConfig" 
                                            :columns="comprehensiveEvaluationColumns"
                                            :formItem="[]" 
                                            :adaptiveHeight="true"
                                        > 
                                            <template v-slot:fwjccmc_slots="{row}" data-desc="自定操作栏">
                                                <span>{{ row.fwjxsmc }}{{ row.fwjlx }}</span>
                                            </template>
                                            <template v-slot:operation_btn="{row}" data-desc="自定操作栏">
                                                <a-form layout="inline" class="search-form" >
                                                    <a-form-item class="vxe-table-box-w">
                                                        <a-button class="blue-btn" type="primary" @click="viewClick(row)" >查看</a-button>
                                                    </a-form-item>
                                                    <a-form-item>
                                                        <a-button class="blue-btn dMould-btn" type="primary" @click="producerMould(row,'综合评定报告书')" >选择模板</a-button>
                                                    </a-form-item>
                                                    <a-form-item v-if="editMode == '服务端模式'">
                                                        <!-- 服务端编辑 -->
                                                        <a-button class="blue-btn" type="primary" @click="serverEdit(row)" >编辑</a-button>
                                                    </a-form-item>
                                                    <a-form-item class="vxe-table-box-w" v-if="row.fwjlx !== '.pdf' && editMode == '客户端模式'">
                                                        <a-button class="blue-btn" type="primary" @click="editClick(row,'综合评定报告书')" >编辑</a-button>
                                                    </a-form-item>
                                                    <a-form-item v-if="row.fwjlx == '.pdf' && editMode == '客户端模式'">
                                                        <a-button class="blue-btn dMould-btn" type="primary" @click="againEdit(row,'综合评定报告书')" >重新编辑</a-button>
                                                    </a-form-item>
                                                    
                                                    <a-form-item class="vxe-table-box-w" >
                                                        <a-button class="red-btn" type="primary" @click="deleteClick(row,'综合评定报告书')" >删除</a-button>
                                                    </a-form-item>
                                                    <a-form-item class="vxe-table-box-w">
                                                        <a-upload style="display: inline-block;" :beforeUpload="segmentBeforeUpload" action="" @change="uploadClick($event,row,'综合评定报告书')">
                                                            <a-button class="blue-btn" type="primary">上传</a-button>
                                                        </a-upload>
                                                    </a-form-item>
                                                    <a-form-item class="vxe-table-box-w">
                                                        <a-button class="blue-btn" type="primary" @click="downloadClick(row)" >下载</a-button>
                                                    </a-form-item>
                                                </a-form>
                                            </template>
                                        </commpVxeTable>
                                    </a-collapse-panel>
                                    <a-collapse-panel key="7" header="移送函模板">
                                        <a-form layout="inline" style="margin-bottom:10px">
                                            <a-form-item >
                                                <a-button class="blue-btn" type="primary" @click="generateRecord('移送函模板','移送函模板')">生成记录</a-button>
                                            </a-form-item>
                                        </a-form>
                                        <commpVxeTable
                                            :key="onSiteDefectsRefresh"
                                            :config="onSiteDefectsConfig" 
                                            :columns="onSiteDefectsColumns"
                                            :formItem="[]" 
                                            :adaptiveHeight="true"
                                        > 
                                            <template v-slot:fwjccmc_slots="{row}" data-desc="自定操作栏">
                                                <span>{{ row.fwjxsmc }}{{ row.fwjlx }}</span>
                                            </template>
                                            <template v-slot:operation_btn="{row}" data-desc="自定操作栏">
                                                <a-form layout="inline" class="search-form" >
                                                    <a-form-item class="vxe-table-box-w">
                                                        <a-button class="blue-btn" type="primary" @click="viewClick(row)" >查看</a-button>
                                                    </a-form-item>
                                                    <a-form-item>
                                                        <a-button class="blue-btn dMould-btn" type="primary" @click="producerMould(row,'移送函模板')" >选择模板</a-button>
                                                    </a-form-item>
                                                    <a-form-item v-if="editMode == '服务端模式'">
                                                        <!-- 服务端编辑 -->
                                                        <a-button class="blue-btn" type="primary" @click="serverEdit(row)" >编辑</a-button>
                                                    </a-form-item>
                                                    <a-form-item class="vxe-table-box-w" v-if="row.fwjlx !== '.pdf' && editMode == '客户端模式'">
                                                        <a-button class="blue-btn" type="primary" @click="editClick(row,'移送函模板')" >编辑</a-button>
                                                    </a-form-item>
                                                    <a-form-item  v-if="row.fwjlx == '.pdf' && editMode == '客户端模式'">
                                                        <a-button class="blue-btn dMould-btn" type="primary" @click="againEdit(row,'移送函模板')" >重新编辑</a-button>
                                                    </a-form-item>
                                                    
                                                    <a-form-item class="vxe-table-box-w" >
                                                        <a-button class="red-btn" type="primary" @click="deleteClick(row,'移送函模板')" >删除</a-button>
                                                    </a-form-item>
                                                    <a-form-item class="vxe-table-box-w">
                                                        <a-upload style="display: inline-block;" :beforeUpload="segmentBeforeUpload" action="" @change="uploadClick($event,row,'移送函模板')">
                                                            <a-button class="blue-btn" type="primary">上传</a-button>
                                                        </a-upload>
                                                    </a-form-item>
                                                    <a-form-item class="vxe-table-box-w">
                                                        <a-button class="blue-btn" type="primary" @click="downloadClick(row)" >下载</a-button>
                                                    </a-form-item>
                                                </a-form>
                                            </template>
                                        </commpVxeTable>
                                    </a-collapse-panel>
                                    <a-collapse-panel key="8" header="整改材料">
                                        <a-collapse v-model:activeKey="collapseActiveKeyArr" class="collapse-original">
                                            <a-collapse-panel key="9" header="审评中心上传" class="collapse-panel-head-l380">
                                                <a-form layout="inline" style="margin-bottom:10px">
                                                    <a-form-item >
                                                        <a-upload style="display: inline-block;" :beforeUpload="segmentBeforeUpload" :showUploadList="false" action="" @change="uploadClick($event,'整改材料')">
                                                            <a-button class="blue-btn" type="primary">上传</a-button>
                                                        </a-upload>
                                                    </a-form-item>
                                                </a-form>
                                                <commpVxeTable
                                                    :key="centerRectificationRefresh"
                                                    :config="centerRectificationConfig" 
                                                    :columns="centerRectificationColumns"
                                                    :formItem="[]" 
                                                    :adaptiveHeight="true"
                                                > 
                                                    <template v-slot:fwjccmc_slots="{row}" data-desc="自定操作栏">
                                                        <span>{{ row.fwjxsmc }}{{ row.fwjlx }}</span>
                                                    </template>
                                                    <template v-slot:operation_btn="{row}" data-desc="自定操作栏">
                                                        <a-form layout="inline" class="search-form" >
                                                            <a-form-item class="vxe-table-box-w">
                                                                <a-button class="blue-btn" type="primary" @click="viewClick(row)" >查看</a-button>
                                                            </a-form-item>
                                                            <a-form-item>
                                                                <a-button class="blue-btn dMould-btn" type="primary" @click="producerMould(row,'整改材料')" >选择模板</a-button>
                                                            </a-form-item>
                                                            <a-form-item v-if="editMode == '服务端模式'">
                                                                <!-- 服务端编辑 -->
                                                                <a-button class="blue-btn" type="primary" @click="serverEdit(row)" >编辑</a-button>
                                                            </a-form-item>
                                                            <a-form-item class="vxe-table-box-w" v-if="row.fwjlx !== '.pdf' && editMode == '客户端模式'">
                                                                <a-button class="blue-btn" type="primary" @click="editClick(row,'整改材料')" >编辑</a-button>
                                                            </a-form-item>
                                                            <a-form-item  v-if="row.fwjlx == '.pdf' && editMode == '客户端模式'">
                                                                <a-button class="blue-btn dMould-btn" type="primary" @click="againEdit(row,'整改材料')" >重新编辑</a-button>
                                                            </a-form-item>
                                                            <a-form-item class="vxe-table-box-w" >
                                                                <a-button class="red-btn" type="primary" @click="deleteClick(row,'整改材料')" >删除</a-button>
                                                            </a-form-item>
                                                            <a-form-item class="vxe-table-box-w">
                                                                <a-upload style="display: inline-block;" :beforeUpload="segmentBeforeUpload" action="" @change="uploadClick($event,row,'整改材料')">
                                                                    <a-button class="blue-btn" type="primary">上传</a-button>
                                                                </a-upload>
                                                            </a-form-item>
                                                            <a-form-item class="vxe-table-box-w">
                                                                <a-button class="blue-btn" type="primary" @click="downloadClick(row)" >下载</a-button>
                                                            </a-form-item>
                                                        </a-form>
                                                    </template>
                                                </commpVxeTable>
                                            </a-collapse-panel>
                                            <a-collapse-panel key="10" header="企业上传">
                                                <commpVxeTable
                                                    :key="enterpriseMaterialsRefresh"
                                                    :config="enterpriseMaterialsConfig" 
                                                    :columns="enterpriseMaterialsColumns"
                                                    :formItem="[]" 
                                                    :adaptiveHeight="true"
                                                > 
                                                    <template v-slot:fwjccmc_slots="{row}" data-desc="自定操作栏">
                                                        <span>{{ row.fwjxsmc }}{{ row.fwjlx }}</span>
                                                    </template>
                                                    <template v-slot:operation_btn="{row}" data-desc="自定操作栏">
                                                        <a-form layout="inline" class="search-form" >
                                                            <!-- <a-form-item class="vxe-table-box-w">
                                                                <a-button class="blue-btn" type="primary" @click="viewClick(row,'企业整改材料')" >查看</a-button>
                                                            </a-form-item> -->
                                                            <a-form-item class="vxe-table-box-w">
                                                                <a-button class="blue-btn" type="primary" @click="downloadClick(row,'企业整改材料')" >下载</a-button>
                                                            </a-form-item>
                                                        </a-form>
                                                    </template>
                                                </commpVxeTable>
                                            </a-collapse-panel>
                                        </a-collapse>
                                    </a-collapse-panel>
                                </a-collapse>
                                <!-- <div style="display: flex;"> -->
                                    <!-- <a-form 
                                        style="margin-top: 20px;"
                                        ref="form"
                                        layout="inline" 
                                        :form="fthyjForm" >
                                        <a-form-item label="被退回意见" v-if="formField.fblzt == '退回'">
                                            {{ formField.fthyj }}
                                        </a-form-item>
                                        <a-form-item label="退回意见" class="comments-or-reasons-box">
                                            <a-textarea placeholder="请输入退回意见" :rows="4" 
                                                v-decorator="['fthyjInput',{ initialValue:formField.fthyjInput, rules: rules.fthyjInput}]"/>
                                        </a-form-item>
                                    </a-form> -->
                                    <!-- <a-form 
                                        style="margin-top: 20px;"
                                        ref="form"
                                        layout="inline" 
                                        :form="inspectionReportForm" >
                                        <a-form-item label="选择办理人">
                                            <a-select
                                                :key="compSelectorkey"
                                                :options="HandledByOptions"
                                                mode="multiple"
                                                placeholder="请选择办理人"
                                                style="width: 200px"
                                                v-decorator="['dbrid',{ initialValue:formField.dbrid, rules: rules.dbrid}]"
                                                
                                                >
                                            </a-select>
                                        </a-form-item>
                                        <a-form-item label="办理意见" class="comments-or-reasons-box">
                                            <a-textarea 
                                                @focus="ideaFocusEvent" 
                                                @blur="ideaBlur"
                                                @click="ideaClick('办理意见','opinion')" 
                                                placeholder="请输入办理意见" 
                                                :rows="4" 
                                                v-decorator="['opinion',{ initialValue:formField.opinion, rules: rules.opinion}]"
                                            />
                                        </a-form-item>
                                        <a-form-item label="下个环节">
                                            <span style="padding-right: 30px;">{{formField.nextNode}}</span>短信通知<a-checkbox style="margin-left: 10px;" v-model:checked="formField.smgflag"></a-checkbox>
                                        </a-form-item>
                                    </a-form> -->
                                <!-- </div> -->
                                <!-- <a-form layout="inline" style="display: flex;justify-content: center;padding-top: 20px;">
                                    <a-form-item label="退回环节">
                                        <a-select
                                        :key="compSelectorkey"
                                        :options="addEditParameter.fthyjOptions"
                                        placeholder="请选择退回环节"
                                        style="width: 130px"
                                        v-model:value="formField.shjid"
                                        >
                                        </a-select>
                                    </a-form-item>
                                    <a-form-item >
                                        <a-button class="blue-btn" type="primary" @click="forwardClick" >退回</a-button>
                                    </a-form-item>
                                    <a-form-item >
                                        <a-button v-if="(addEditParameter.fscms == '技术审评' && addEditParameter.fcywczt == '是') || (addEditParameter.fscms == '技术审评' && addEditParameter.fspwczt == '是') || (addEditParameter.fscms == '技术审评+技术审评' && addEditParameter.fcywczt == '是' && addEditParameter.fspwczt == '是')"  class="blue-btn" type="primary" @click="segmentSubmitClick(2)" >提交</a-button>
                                        <span v-else>提示：<span style="color: #ed5565;">{{(addEditParameter.fscms == '技术审评' && addEditParameter.fcywczt == '否') || (addEditParameter.fscms == '技术审评+技术审评' && addEditParameter.fcywczt == '否') ?'技术审评未完成':''}}</span> <span style="color: #ed5565;">{{(addEditParameter.fscms == '技术审评+技术审评' && addEditParameter.fspwczt == '否') || (addEditParameter.fscms == '技术审评' && addEditParameter.fspwczt == '否')?'技术审评未完成':''}}</span> 不能进行提交</span>
                                    </a-form-item>
                                </a-form> -->
                            </a-tab-pane>
                        </a-tabs>
                        <a-modal
                        :title="ideaType"
                        v-model:visible="ideaVisible"
                        @ok="ideaHandleOk"
                        class="idea-modal-box"
                        @cancel="ideaVisible = false"
                        >
                            <a-form layout="inline">
                                <a-form-item :label="ideaType" class="pull-input-w">
                                    <div style="display: flex;align-items: center;">
                                        <vxe-textarea
                                        rows="3" 
                                        @focus="recordCommentsFocus" 
                                        @blur="recordCommentsBlur" 
                                        @change="recordCommentsChange"  
                                        v-model="opinionsText" 
                                        :placeholder="'请输入或选择'+ideaType" 
                                        suffix-icon="vxe-icon-search">
                                        </vxe-textarea>
                                        <a-button style="margin-left: 15px;" class="blue-btn"  type="primary" @click.stop="saveComments" >保存</a-button>
                                    </div>
                                    <!-- <vxe-input
                                    @focus="recordCommentsFocus" 
                                    @blur="recordCommentsBlur" 
                                    @change="recordCommentsChange"  
                                    v-model:value="opinionsText" 
                                    :placeholder="'请输入或选择'+ideaType" 
                                    suffix-icon="vxe-icon-search"></vxe-input> -->
                                    <div class="opinion-record-box" v-show="isRecordComments">
                                        <div v-if="segOpinionsList.length" class="content-box">
                                            <div v-for="(item,index) in segOpinionsList" class="content-for">
                                                <div @click.stop="selectIdea(item)"  class="content-item">
                                                    <span class="content-text" v-if="ideaType=='办理意见'" >{{ item.fcontent}}</span>
                                                    <span class="content-text" v-else >{{ item.fzdnr}}</span>
                                                    <!-- item.fzdnr -->
                                                    <a-button class="red-btn" size="small" type="primary" @click.stop="deleteIdea(item)" >删除</a-button>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="no-data-box" v-else>暂无记录！</div>
                                    </div>
                                </a-form-item>
                            </a-form>
                        </a-modal>
                        <a-modal
                            :width="1000"
                            title="选择模板"
                            :visible="selectTemplateVisible"
                            @ok="selectTemplateHandleOk"
                            @cancel="selectTemplateVisible = false"
                            :forceRender="true"
                        >
                            <commpVxeTable
                                :key="selectTemplateKey"
                                :config="selectTemplateConfig" 
                                :columns="selectTemplatecolumnsVxe" 
                                :formItem="selectTemplateformItem"
                                @radioChange="selectTemplateChange"
                                ref="acceptanceRegistrationRef"
                            >
                            </commpVxeTable>
                        </a-modal>
                    </div>
                </a-spin>
            </div>
        </a-modal>
        <serverEditing ref="serverEditingRef" @refreshChange="refreshFunction(1)"/>
        <serverEditingView ref="serverEditingViewRef" @refreshChange="$event=>{}"/>
        <selectTemplate ref="selectTemplateRef" @selectTemplateComplete="selectTemplateComplete"/>
        <processingConditionsAll ref="processingConditionsAllRef" :processingData="processingData" @interfaceSuccessful="interfaceSuccessful"></processingConditionsAll>
        <supplementaryRectification ref="supplementaryRectificationRef" @rectificationSuccess="rectificationSuccess"/>
        <supplementaryHistory ref="supplementaryHistoryRef"/>
    </div>
</template>
<script>
import selectTemplate from '@/components/selectTemplate/selectTemplate.vue'
import serverEditingView from '@/components/comp-model-series/server-editing-view'
import eventSet from '../acceptanceRegistration/eventSet.vue'
import serverEditing from '@/components/comp-model-series/server-editing.vue'
import {addSqsxBasicServe} from './service/index'
import segmentcomp from '../siteInspection/segment.vue'
import technicalReview from '../siteInspection/technicalReview.vue'
import commpVxeTable from '@/components/commp-vxe-table/commp-vxe-table.vue'
import assessCheckApi from './service/api'
import blobType from '@/common/blobType'
import YchConstant from "@/api/YchConstant";
import { handlingOpinionsListServe,
        queryListYwflServe,
        deleteBatchIdeaServe,
        spcyRsYwzdxxDeleteServe,
        addBatchIdeaServe,
        spcyRsYwzdxxAddServe,
        addServe,
        initWjjlServe,
        initZgqrFlow,
        editServe,
        getFileTypeServe,
        downloadXzxkFjxx,
        getLocalFileByIdServe,
        deleteFileByIdServe,
        uploadMoreTypeFileServe,
        uploadPdfFileById,
        spcySqsxWjjluploadMoreTypeFile,
        returnUpperXcjcFlowJob,
        getComprehensiveConclusionsMap,
        againEditPdfFile,
        autoPdbhBySqsxId,
        autoYshbhBySqsxId,
        selectWjmbServe,
        spzgqrlcReturnZgqrFlow,
        spzgqrlcEndFlowJob,
        
} from './service/index'
import compSelector from '@/components/compSelector/compSelector.vue'
import examination from '../siteInspection/examination.vue'
export default {
    components:{
        serverEditing,
        eventSet,
        segmentcomp,
        technicalReview,
        commpVxeTable,
        compSelector,
        examination,
        serverEditingView,
        selectTemplate,
    },
    props:{
        addEditParameter:{
            type:[Array,Object],
            default: () => {},
            required:false
        },
        addEdittechnicalReview:{
            type:[Array,Object],
            default: () => {},
            required:false
        }
    },
    watch:{
        addEditParameter: {
            handler (newval, oldVal) {
                
            },
            immediate: true,
            deep: true
        },
        
    },
    data(){
        return{
            processingData:{},
            matterActiveKey:'事项办理',
            spinning:true,
            HandledByOptions:[],
            rules:{
                opinion: [{
                    required: true,
                    message: '请输入办理意见',
                    trigger: 'blur',
                }],
                dbrid: [{
                    type:'array',
                    required: true,
                    message: '请选择办理人',
                    trigger: 'blur',
                }],
                fthyjInput: [{
                    required: true,
                    message: '请输入退回意见',
                    trigger: 'blur',
                }],
            },
            inspectionReportForm:this.$form.createForm(this, { name: 'inspectionReportFormName' }),
            fthyjForm:this.$form.createForm(this, { name: 'fthyjForm' }),
            ideaType:'办理意见',
            ideaVisible:false,
            collapseActiveKeyArr:['1','2','3','4','5','6','7','8','9','10','11','12','13'],
            tabsModeValue:'技术审评',
            visibleShow:false,
            confirmLoading:false,
            formField:{},
            formRequer:'',
            submittedSuccessfully:false,
            parameterData:{},
            compSelectorkeys:null,
            headerText1:this.addEditParameter.fsqdbh?'申请单编号：'+this.addEditParameter.fsqdbh:'',
            headerText2:this.addEditParameter.fslbh?('  受理编号：'+this.addEditParameter.fslbh):'',
            flowPath2Parameter:{},
            //补正通知
            correctionNoticeRefresh:null,
            correctionNoticeConfig:{
                api:assessCheckApi.queryInitQtWjjlList,
                rowId: 'id',
                fywflcode:blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))],
                height:400,
                autoHidden:true,
                pageSize:100,
                listData:'bztzList',
                paramet:{
                    sqsxid:this.addEditParameter.sqsxid
                }
            },
            correctionNoticeColumns:[{
                title: '补充整改通知', //列头显示文字
                field: 'fwjccmc',
                slots: {
                    // 使用插槽模板渲染
                    default: 'fwjccmc_slots',
                },
            },{
                title: '操作',
                field: 'id',
                slots: {
                    // 使用插槽模板渲染
                    default: 'operation_btn',
                },
                width:750,
                fixed:'right'
            }],
            rectificationNoticeRefresh:null,
            rectificationNoticeConfig:{
                api:assessCheckApi.queryInitQtWjjlList,
                rowId: 'id',
                fywflcode:blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))],
                height:400,
                autoHidden:true,
                pageSize:100,
                listData:'zhpdbgsList',
                paramet:{
                    sqsxid:this.addEditParameter.sqsxid
                }
            },
            rectificationNoticeColumns:[{
                title: '综合评定报告书', //列头显示文字
                field: 'fwjccmc',
                slots: {
                    // 使用插槽模板渲染
                    default: 'fwjccmc_slots',
                },
            },{
                title: '操作',
                field: 'id',
                slots: {
                    // 使用插槽模板渲染
                    default: 'operation_btn',
                },
                width:750,
                fixed:'right'
            }],
            //综合评定报告书
            comprehensiveEvaluationRefresh:null,
            comprehensiveEvaluationConfig:{
                api:assessCheckApi.queryInitQtWjjlList,
                rowId: 'id',
                fywflcode:blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))],
                height:400,
                autoHidden:true,
                pageSize:100,
                listData:'zhpdbgsList',
                paramet:{
                    sqsxid:this.addEditParameter.sqsxid
                }
            },
            comprehensiveEvaluationColumns:[{
                title: '综合评定报告书', //列头显示文字
                field: 'fwjccmc',
                slots: {
                    // 使用插槽模板渲染
                    default: 'fwjccmc_slots',
                },
            },{
                title: '操作',
                field: 'id',
                slots: {
                    // 使用插槽模板渲染
                    default: 'operation_btn',
                },
                width:750,
                fixed:'right'
            }],
            //移送函模板
            onSiteDefectsRefresh:null,
            onSiteDefectsConfig:{
                api:assessCheckApi.queryInitQtWjjlList,
                rowId: 'id',
                fywflcode:blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))],
                height:400,
                autoHidden:true,
                pageSize:100,
                listData:'yshmbList',
                paramet:{
                    sqsxid:this.addEditParameter.sqsxid
                }
            },
            onSiteDefectsColumns:[{
                title: '移送函模板', //列头显示文字
                field: 'fwjccmc',
                slots: {
                    // 使用插槽模板渲染
                    default: 'fwjccmc_slots',
                },
            },{
                title: '操作',
                field: 'id',
                slots: {
                    // 使用插槽模板渲染
                    default: 'operation_btn',
                },
                width:750,
                fixed:'right'
            }], 
            //技术审评缺陷项目记录表
            onSiteProjectsRefresh:null,
            onSiteProjectsConfig:{
                api:assessCheckApi.queryInitQtWjjlList,
                rowId: 'id',
                fywflcode:blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))],
                height:400,
                autoHidden:true,
                pageSize:100,
                listData:'xcjcqxxmjlbList',
                paramet:{
                    sqsxid:this.addEditParameter.sqsxid
                }
            },
            onSiteProjectsColumns:[{
                title: '技术审评缺陷项目记录表', //列头显示文字
                field: 'fwjccmc',
                slots: {
                    // 使用插槽模板渲染
                    default: 'fwjccmc_slots',
                },
            },{
                title: '操作',
                field: 'id',
                slots: {
                    // 使用插槽模板渲染
                    default: 'operation_btn',
                },
                width:750,
                fixed:'right'
            }], 
            ideaVisible:false,
            opinionsText:'',
            ideaType:'',
            segOpinionsList:[],
            isRecordComments:false,
            formFieldKey:'',
            compSelectorkey:null,
            fzhjgKey:null,
            spinningKey:null,
            selectTemplateVisible:false,
            selectTemplateKey:null,
            templateId:'',
            takeNotesId:'',
            takeNotesType:'',
            selectTemplateConfig:{
                api:assessCheckApi.queryYwflWjmbList,
                rowId: 'id',
                fywflcode:blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))],
                height:400,
                autoHidden:true,
                pageSize:100,
                selectType:'radio',
                listData:'wjmbList',
                paramet:{
                    sqsxid:this.addEditParameter.sqsxid
                }
            },
            selectTemplatecolumnsVxe:[{
                type:'radio',
                width:60,
            },{
                title: '模板标题', //列头显示文字
                field: 'fmbbt',
                key: 'fmbbt',
            },{
                title: '文件类型', //列头显示文字
                field: 'fwjlx',
                key: 'fwjlx',
            },{
                title: '模板类型1', //列头显示文字
                field: 'fmblx1',
                key: 'fmblx1',
            }],
            //整改通知书
            rectificationProcessRefresh:null,
            rectificationProcessConfig:{
                api:assessCheckApi.queryInitQtWjjlList,
                rowId: 'id',
                fywflcode:blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))],
                height:400,
                autoHidden:true,
                pageSize:100,
                listData:'zgtzsList',
                paramet:{
                    sqsxid:this.addEditParameter.sqsxid
                }
            },
            rectificationProcessColumns:[{
                title: '整改通知书', //列头显示文字
                field: 'fwjccmc',
                slots: {
                    // 使用插槽模板渲染
                    default: 'fwjccmc_slots',
                },
            },{
                title: '操作',
                field: 'id',
                slots: {
                    // 使用插槽模板渲染
                    default: 'operation_btn',
                },
                width:750,
                fixed:'right'
            }],
            rectificationRefresh:null,
            rectificationConfig:{
                api:assessCheckApi.spzgqrlcFlowJkPage,
                rowId: 'id',
                fywflcode:blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))],
                height:400,
                autoHidden:true,
                pageSize:100,
                // listData:'zgtzsList',
                paramet:{
                    sqsxid:this.addEditParameter.sqsxid
                }
            },
            rectificationcolumnsVxe:[{
                title: '企业名称', //列头显示文字
                field: 'fqymc',
            },{
                title: '环节名称',
                field: 'fhjmc',
            },{
                title: '待办人',
                field: 'fdbr',
            },{
                title: '发送人',
                field: 'ffsrmc',
            },{
                title: '发送时间',
                field: 'ffssj',
                slots: {
                    // 使用插槽模板渲染
                    default: 'name_ffssj',
                },
            },{
                title: '办理状态',
                field: 'fblzt',
                slots: {
                    // 使用插槽模板渲染
                    default: 'name_fblzt',
                },
            },{
                title: '操作',
                field: 'id',
                slots: {
                    // 使用插槽模板渲染
                    default: 'operation_btn',
                },
                width:260,
                fixed:'right'
            }], 
            REPORTKey:null,
            REPORTConfig:{
                api:assessCheckApi.queryInitQtWjjlList,
                rowId: 'id',
                fywflcode:blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))],
                height:400,
                autoHidden:true,
                pageSize:100,
                listData:'zgqrbgsList',
                paramet:{
                    sqsxid:this.addEditParameter.sqsxid
                }
            },
            REPORTColumns:[{
                title: '整改确认报告书', //列头显示文字
                field: 'fwjccmc',
                slots: {
                    // 使用插槽模板渲染
                    default: 'fwjccmc_slots',
                },
            },{
                title: '操作',
                field: 'id',
                slots: {
                    // 使用插槽模板渲染
                    default: 'operation_btn',
                },
                width:750,
                fixed:'right'
            }],
            centerRectificationRefresh:null,
            centerRectificationConfig:{
                api:assessCheckApi.queryZgWjjlList,
                rowId: 'id',
                fywflcode:blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))],
                height:400,
                autoHidden:true,
                pageSize:100,
                listData:'zxzgList',
                paramet:{
                    sqsxid:this.addEditParameter.sqsxid
                }
            },
            centerRectificationColumns:[{
                title: '审评中心整改材料', //列头显示文字
                field: 'fwjccmc',
                slots: {
                    // 使用插槽模板渲染
                    default: 'fwjccmc_slots',
                },
            },{
                title: '操作',
                field: 'id',
                slots: {
                    // 使用插槽模板渲染
                    default: 'operation_btn',
                },
                width:750,
                fixed:'right'
            }],
            enterpriseMaterialsRefresh:null,
            enterpriseMaterialsConfig:{
                api:assessCheckApi.queryZgclFileList,
                rowId: 'id',
                fywflcode:blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))],
                height:400,
                autoHidden:true,
                pageSize:100,
                listData:'qyzgclList',
                paramet:{
                    sqsxid:this.addEditParameter.sqsxid
                }
            },
            enterpriseMaterialsColumns:[{
                title: '企业整改材料', //列头显示文字
                field: 'fjymc',
            },{
                title: '操作',
                field: 'id',
                slots: {
                    // 使用插槽模板渲染
                    default: 'operation_btn',
                },
                width:750,
                fixed:'right'
            }],
        }
    },
    computed: {
        editMode(){
            return this.$store.state.permission.editMode
        },
    },
    mounted(){
    },
    updated(){
        this.cancelLoading()
    },
    methods:{
        getData(newval){
            this.matterActiveKey='事项办理'
            this.spinning = true
            //console.log('技术审评办理获取到了什么',newval)
            this.parameterData = newval
            this.$nextTick(()=>{
                this.$refs.eventSetRef.getDatas(newval)
            })
            this.formField = JSON.parse(JSON.stringify(newval))
            this.formField.fzhbgqtwt = newval.fzhbgqtwt?newval.fzhbgqtwt:'无'
            //console.log('技术审评办理获取到了什么',this.formField)
            this.formField.nextNodeDbrList.forEach(item => {
                item = {
                    value:item.dbrid,
                    label:item.dbr
                }
                this.HandledByOptions.push(item)
            });
            this.correctionNoticeConfig.paramet.sqsxid = this.formField.sqsxid
            this.comprehensiveEvaluationConfig.paramet.sqsxid = this.formField.sqsxid
            this.onSiteDefectsConfig.paramet.sqsxid = this.formField.sqsxid
            this.onSiteProjectsConfig.paramet.sqsxid = this.formField.sqsxid
            this.rectificationProcessConfig.paramet.sqsxid = this.formField.sqsxid
            this.rectificationConfig.paramet.sqsxid = this.formField.sqsxid
            this.REPORTConfig.paramet.sqsxid = this.formField.sqsxid
            this.centerRectificationConfig.paramet.sqsxid = this.formField.sqsxid
            this.enterpriseMaterialsConfig.paramet.sqsxid = this.formField.sqsxid
            this.compSelectorkeys = Date.now()
            this.tabsModeValue = newval.fscms == '技术审评'?'技术审评':'技术审评'
            if(newval.fcywczt == '否' && newval.fspwczt == '否'){
                this.tabsModeValue = '综合结论'
            }
            
        },
        matterChange(){
            // if(this.matterActiveKey == '事项信息'){
            //     this.$nextTick(()=>{
            //         this.$refs.eventSetRef.getDatas(this.parameterData)
            //     })
            // }
        },
        cancelLoading(){
            let timer = setInterval((val)=>{
                this.spinning = false
                clearInterval(timer);
            },500)
            
        },
        refreshFunction(name){
            if(name == '补正通知' || name == 1){
                this.correctionNoticeRefresh = Date.now()
            }
            if(name == '综合评定报告书' || name == 1){
                this.comprehensiveEvaluationRefresh = Date.now()
            }
            if(name == '移送函模板' || name == 1){
                this.onSiteDefectsRefresh = Date.now()
            }
            if(name == '技术审评缺陷项目记录表' || name == 1){
                this.onSiteProjectsRefresh = Date.now()
            }
            if(name == '整改通知书' || name == 1){
                this.rectificationNoticeRefresh = Date.now()
            }
            if(name == '整改通知书' || name == 1){
                this.rectificationProcessRefresh = Date.now()
            }
            if(name == '整改确认报告书' || name == 1){
                this.REPORTKey = Date.now()
            }
            if(name == '生成流程' || name == 1){
                this.rectificationRefresh = Date.now()
            }
            if(name == '整改材料' || name == 1){
                this.centerRectificationRefresh = Date.now()
            }
            this.enterpriseMaterialsRefresh = Date.now()
            


        },
        returnClick(){//返回
            this.visibleShow = false
        },
        refreshClick(){
            this.spinning = true
            this.spinningKey = Date.now()
            this.cancelLoading()
        },
        preserveClick(){//保存
            this.$refs.dealWithRef.handlePreserve()
        },
        // submitClick(){//提交
        //     this.$refs.dealWithRef.shandleSubmit()
        // },
        successReturn(val){
            this.visibleShow = val
            this.$emit('successReturn')
        },
        //重新编辑
        againEdit(val,name){
            var that = this
            this.$confirm({
                title:'您确认删除已生成的pdf重新编辑文档吗？',
                // icon: createVNode(ExclamationCircleOutlined),
                onOk() {
                    againEditPdfFile({id:val.id}).then(res=>{
                        if(res.code == 200){
                            that.$webOffice(
                                `api/spzx-spcy/spcyRsWjmb/openWjjl?id=${res.result.id}`,
                                `api/spzx-spcy/spcyRsWjmb/onLineSaveWjjl?id=${res.result.id}`+`-name=${val.fwjlx1+val.fwjlx}`,
                                `api/spzx-spcy/spcyRsWjmb/saveFileToPdf2?id=${res.result.id}`+`&sqsxid=${that.formField.sqsxid}`,
                                `api/spzx-spcy/spcyRsWjmb/saveFileGzToPdf2?id=${res.result.id}`+`&sqsxid=${that.formField.sqsxid}`,
                                `api/spzx-spcy/spcyRsWjmb/againEditOutPdfFile?id=${res.result.id}`,
                            )
                            that.refreshFunction(name)
                        }else{
                            that.$message.warning(res.message)
                        }
                    })
                },
                
            });
        },
        //服务端编辑
        serverEdit(val){
            this.$refs.serverEditingRef.getData(val)
        },
         //在线编辑
         editClick(val,name){
            var that = this
            //console.log('在线编辑',val)
            if(val.fwjlx == '.pdf'){
                this.$message.warning('pdf文件无法编辑')
            }else{
                // window.localStorage.setItem('FieldPdf','0')
                // this.modelType = 2
                getFileTypeServe({id:val.id}).then(res=>{
                    if(res.code == 200){
                        if(res.result !== '.pdf'){
                            that.$webOffice(
                                `api/spzx-spcy/spcyRsWjmb/openWjjl?id=${val.id}`,
                                `api/spzx-spcy/spcyRsWjmb/onLineSaveWjjl?id=${val.id}`+`-name=${val.fwjlx1+val.fwjlx}`,
                                `api/spzx-spcy/spcyRsWjmb/saveFileToPdf?id=${val.id}`+`&sqsxid=${this.formField.sqsxid}`,
                                `api/spzx-spcy/spcyRsWjmb/saveFileGzToPdf?id=${val.id}`+`&sqsxid=${this.formField.sqsxid}`,
                                `api/spzx-spcy/spcyRsWjmb/againEditOutPdfFile?id=${val.id}`,
                            )
                        }else{
                            this.refreshFunction(name)
                            this.$message.warning('pdf文件无法编辑')
                        }
                        
                    }
                    
                })
                
            }
        },
        deleteClick(val,name){
            var that = this
            this.$confirm({
                title:'您确认要删除吗？',
                // icon: createVNode(ExclamationCircleOutlined),
                onOk() {
                    deleteFileByIdServe({id:val.id}).then(res=>{
                        if(res.code == 200){
                            that.refreshFunction(name)
                            that.getHandlingOpinionsList(that.ideaType,that.opinionsText)
                        }else{
                            that.$message.warning(res.message)
                        }
                    })
                },
                
            });
            
        },
        segmentBeforeUpload(){
            return false
        },
        //上传
        uploadClick({file},val){//
            var that = this
            if(typeof file.uid !== 'undefined') {
                // if(file.name.indexOf(".xls") !== -1 || file.name.indexOf(".xlsx") !==-1) {
                    const fileData = new FormData();
                    fileData.append("file",file);
                    fileData.append("fywflcode",blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))]);
                    fileData.append("sqsxid",this.formField.sqsxid);
                    if(val == '整改材料'){
                        fileData.append("fwjlx1",'整改材料');
                        spcySqsxWjjluploadMoreTypeFile(fileData).then(res => {
                            if(res.code !== 200){
                                that.$message.warning('请上传pdf文件或者联系管理员!')
                            }else{
                                this.refreshFunction(1)
                                that.$message.success('上传成功')
                            }
                            
                        })
                    }else{
                        uploadPdfFileById(fileData).then(res => {
                            if(res.code !== 200){
                                that.$message.warning('请上传pdf文件或者联系管理员!')
                            }else{
                                this.refreshFunction(1)
                                that.$message.success('上传成功')
                            }
                        })
                    }
                // }
                
            }
        },
        viewClick(val){
            this.$refs.serverEditingViewRef.getData({id:val.id,fwjlx:val.fwjlx})
            this.$refs.serverEditingViewRef.serverEditingVisible = true
        },
        //查看
        lookOverClick(val){
            getFileTypeServe({id:val.id}).then(res=>{
                if(res.code == 200){
                    if(res.result == '.pdf'){
                        window.open(
                            bootConfig[process.env.NODE_ENV].locality_ApI+YchConstant.SPZX_SPCY+'/spcySqsxWjjl/getCrossLocalFile?id='+val.id
                        )
                    }else{
                        this.$message.warning('只能查看pdf文件')
                    }
                    
                }
                
            })
            
        },
        //下载
        downloadClick(val,name){
            var that = this
            var fileName = val.fwjccmc
            let param = { fywflcode:blobType.fywflcodeArr[blobType.menuType.indexOf(this.$route.name.substring(this.$route.name.indexOf('__'),this.$route.name.indexOf('_a')+2))],id:val.id,sqsxid:this.formField.sqsxid}
            if(name == '企业整改材料'){
                let fwjlx = val.fjymc.slice(val.fjymc.lastIndexOf('.'))
                fileName = val.fjymc.slice(0,val.fjymc.lastIndexOf('.')-1)
                downloadXzxkFjxx(param).then((data) => {
                    if (!data) {
                        that.$message.warning('文件下载失败')
                    return
                    }
                    // if (typeof window.navigator.msSaveBlob !== 'undefined') {
                    //     window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }))
                    // } else {
                        let url = window.URL.createObjectURL(new Blob([data], { type: blobType.type[blobType.suffix.indexOf(fwjlx)] }))
                        let link = document.createElement('a')
                        link.style.display = 'none'
                        link.href = url
                        link.setAttribute('download', fileName + res.result)
                        document.body.appendChild(link)
                        link.click()
                        document.body.removeChild(link) //下载完成移除元素
                        window.URL.revokeObjectURL(url) //释放掉blob对象
                    // }
                })
            }else{
                getFileTypeServe({id:val.id}).then(res=>{
                    if(res.code == 200){
                        getLocalFileByIdServe(param).then((data) => {
                            if (!data) {
                                that.$message.warning('文件下载失败')
                            return
                            }
                            // if (typeof window.navigator.msSaveBlob !== 'undefined') {
                            //     window.navigator.msSaveBlob(new Blob([data], { type: 'application/vnd.ms-excel' }))
                            // } else {
                                let url = window.URL.createObjectURL(new Blob([data], { type: blobType.type[blobType.suffix.indexOf(val.fwjlx)] }))
                                let link = document.createElement('a')
                                link.style.display = 'none'
                                link.href = url
                                link.setAttribute('download', fileName + res.result)
                                document.body.appendChild(link)
                                link.click()
                                document.body.removeChild(link) //下载完成移除元素
                                window.URL.revokeObjectURL(url) //释放掉blob对象
                            // }
                        })
                    }
                    
                })
            }
        },
        getHandlingOpinionsList(ideaType,val){//查询业务类型
            
            if(ideaType == '办理意见'){
                handlingOpinionsListServe({ftype1:ideaType,pageNo:1,pageSize:1000,fcontent:val}).then(res=>{
                    if(res.code == 200){
                        //console.log('办理意见',res)
                        this.segOpinionsList = res.result.records
                    }
                })

            }else{
                queryListYwflServe({ftype1:ideaType,fzdnr:val}).then(res=>{
                    if(res.code == 200){
                        //console.log('查询弹窗数据',res)
                        this.segOpinionsList = res.result
                    }
                })
            }
            
        },
        //弹窗输入框输入
        recordCommentsChange(){
            this.getHandlingOpinionsList(this.ideaType,this.opinionsText)
        },
        //选择弹窗选择
        selectIdea(val){
            this.opinionsText = this.ideaType == '办理意见'?val.fcontent:val.fzdnr
            this.isRecordComments = false
        },
        recordCommentsFocus(){
            this.isRecordComments = true
        },
        recordCommentsBlur(){},
        
        //删除意见
        deleteIdea(val,name){
            if(this.ideaType == '办理意见'){
                deleteBatchIdeaServe({ids:val.id}).then(res=>{
                    if(res.code == 200){
                        this.refreshFunction(name)
                        this.$message.success('删除成功')
                    }else{
                        this.$message.warning(res.message)
                    }
                })
            }else{
                spcyRsYwzdxxDeleteServe({id:val.id}).then(res=>{
                    if(res.code == 200){
                        this.refreshFunction(name)
                        this.$message.success('删除成功')
                    }else{
                        this.$message.warning(res.message)
                    }
                })
            }
            
        },
        ideaHandleOk(){
            this.ideaVisible = false
            // if(this.opinionsText !== this.formField[this.formFieldKey]){
                
                this.formField[this.formFieldKey] = this.opinionsText
                
                if(this.formFieldKey == 'opinion'){
                    this.inspectionReportForm.setFieldsValue({
                        opinion:this.opinionsText,
                    });
                }
                
            // }
            
        },
        saveComments(){
            this.ideaHandleOk()
            if(this.opinionsText){
                if(this.ideaType == '办理意见'){
                    addBatchIdeaServe({ftype1:this.ideaType,fcontent:this.opinionsText}).then(res=>{
                        if(res.code == 200){
                            this.$message.success(res.message)
                        }else{
                            this.$message.warning(res.message)
                        }
                        this.getHandlingOpinionsList(this.ideaType,this.opinionsText)
                    })
                }else{
                    spcyRsYwzdxxAddServe({ftype1:this.ideaType,fzdnr:this.opinionsText}).then(res=>{
                        if(res.code == 200){
                            this.$message.success(res.message)
                        }else{
                            this.$message.warning(res.message)
                        }
                        this.getHandlingOpinionsList(this.ideaType,this.opinionsText)
                    })
                }
            }
            
        },
        //获取结论
        getConclusion(key){
            getComprehensiveConclusionsMap({sqsxid:this.formField.sqsxid}).then(res=>{
                if(res.code == 200){
                    key.forEach(item=>{
                        this.formField[item] = res.result[item]
                    })
                    this.fzhjgKey = Date.now()
                    this.$message.success(res.message)
                }else{
                    this.$message.warning(res.message)
                }
            })
        },
        //获取编号
        getNumber(title,key){
            if(title == '评定编号'){
                autoPdbhBySqsxId().then(res=>{
                    if(res.code == 200){
                        this.formField[key] = res.result[key]
                        this.$message.success(res.message)
                    }else{
                        this.$message.warning(res.message)
                    }
                })
            }else{
                autoYshbhBySqsxId().then(res=>{
                    if(res.code == 200){
                        this.formField[key] = res.result[key]
                        this.$message.success(res.message)
                    }else{
                        this.$message.warning(res.message)
                    }
                })
            }
        },
        //生成记录
        generateRecord(val,name){
            if(val == '生成流程'){
                initZgqrFlow({sqsxid:this.formField.sqsxid}).then(res2=>{
                    if(res2.code == 200){
                        this.refreshFunction(name)
                        this.$message.success(res2.message)
                    }else{
                        this.$message.warning(res2.message)
                    }
                })
            }else{
                //console.log(name)
                initWjjlServe({sqsxid:this.formField.sqsxid,type:val}).then(res=>{
                    if(res.code == 200){
                        this.correctionNoticeConfig.paramet.sqsxid = this.formField.sqsxid
                        this.comprehensiveEvaluationConfig.paramet.sqsxid = this.formField.sqsxid
                        this.onSiteDefectsConfig.paramet.sqsxid = this.formField.sqsxid
                        this.onSiteProjectsConfig.paramet.sqsxid = this.formField.sqsxid
                        this.rectificationProcessConfig.paramet.sqsxid = this.formField.sqsxid
                        this.rectificationConfig.paramet.sqsxid = this.formField.sqsxid
                        this.REPORTConfig.paramet.sqsxid = this.formField.sqsxid
                        this.centerRectificationConfig.paramet.sqsxid = this.formField.sqsxid
                        this.enterpriseMaterialsConfig.paramet.sqsxid = this.formField.sqsxid
                        this.refreshFunction(name)
                        this.$message.success('已生成记录')
                    }else{
                        this.$message.warning(res.message)
                    }
                })
            }
        },
        expertProcessReturn(val){
            //console.log(val)
            var that = this
            this.$confirm({
                title:'您确认要退回吗？',
                // icon: createVNode(ExclamationCircleOutlined),
                onOk() {
                    spzgqrlcReturnZgqrFlow({jobid:val.jobid}).then(res=>{
                        if(res.code == 200){
                            that.$message.success(res.message)
                            that.refreshFunction(1)
                        }else{
                            that.$message.warning(res.message)
                        }
                    })
                },
                
            });
        },
        expertProcesstErmination(row){
            var that = this
            this.$confirm({
                title:'您确认要终止吗？',
                // icon: createVNode(ExclamationCircleOutlined),
                onOk() {
                    spzgqrlcEndFlowJob({jobid:row.jobid}).then(res=>{
                        if(res.code == 200){
                            that.$message.warning(res.message)
                            that.refreshFunction(1)
                        }else{
                            that.$message.warning(res.message)
                        }
                    })
                    
                },
                
            });
            
        },
        producerMould(row,val){
            this.$refs.selectTemplateRef.getSelectTemplate(row,val,this.formField.sqsxid)
            this.$refs.selectTemplateRef.selectTemplateVisible = true
        },
        selectTemplateComplete(){
            this.refreshFunction(1)
        },
        ideaFocusEvent(){
            // this.ideaBlur()
        },
        ideaBlur(){},
        //打开弹窗
        ideaClick(val,name){
            this.ideaVisible = true
            this.formFieldKey = name
            this.ideaType = val
            this.opinionsText = this.formField[name]
            this.getHandlingOpinionsList(val,this.formField[name])
        },
        //退回
        forwardClick(){
            var that = this
            this.$confirm({
                title:'您确认要退回吗？',
                // icon: createVNode(ExclamationCircleOutlined),
                onOk() {
                    that.fthyjForm.validateFields((err, values) => {
                        if(!err){
                            returnUpperXcjcFlowJob({jobid:that.formField.jobid,shjid:that.formField.shjid,opinion:values.fthyjInput}).then(res=>{
                                if(res.code == 200){
                                    that.successReturn(false)
                                    that.$message.success(res.message)
                                }else{
                                    that.$message.warning(res.message)
                                }
                            })
                        }
                    })
                },
                
            });
        },
        segmentSubmitClick(val,isTip){
            let canHandle = false
            var that = this
            if(val == 1){
                let data = {
                    jobid:that.formField.jobid,
                    sqsxid:that.formField.sqsxid,
                    dbrid:'',
                    opinion:'',
                    smgflag:that.formField.smgflag?'是':'否',
                    map:{
                        fcyjcyj:that.formField.fcyjcyj,
                        fcyjcfw:that.formField.fcyjcfw,
                        fcyptbm:that.formField.fcyptbm,
                        fcyptry:that.formField.fcyptry,
                        fcyptryzw:that.formField.fcyptryzw,
                        fcyjg:that.formField.fcyjg,
                        fcyyzqx:that.formField.fcyyzqx,
                        fcyzyqx:that.formField.fcyzyqx,
                        fcyybqx:that.formField.fcyybqx,
                        fcyqtwt:that.formField.fcyqtwt,
                        fzhjl:that.formField.fzhjl,
                        fzhjg:that.formField.fzhjg,
                        fzhbgqtwt:that.formField.fzhbgqtwt,
                        fpdbh:that.formField.fpdbh,
                        fyshbh:that.formField.fyshbh,
                    }
                }
                addServe(data).then(res=>{
                    if(res.code == 200){
                        that.successReturn(true)
                        if(!isTip){
                            that.$message.success(res.message)
                        }
                    }else{
                        that.$message.warning(res.message)
                    }
                })
            }else if(val == 2){

                this.inspectionReportForm.validateFields((err, values) => {
                    if(!err){
                        // let data = {
                        //     jobid:that.formField.jobid,
                        //     sqsxid:that.formField.sqsxid,
                        //     dbrid:values.dbrid.join(','),
                        //     opinion:values.opinion,
                        //     smgflag:that.formField.smgflag?'是':'否',
                        //     map:{
                        //         fcyjcyj:that.formField.fcyjcyj,
                        //         fcyjcfw:that.formField.fcyjcfw,
                        //         fcyptbm:that.formField.fcyptbm,
                        //         fcyptry:that.formField.fcyptry,
                        //         fcyptryzw:that.formField.fcyptryzw,
                        //         fcyjg:that.formField.fcyjg,
                        //         fcyyzqx:that.formField.fcyyzqx,
                        //         fcyzyqx:that.formField.fcyzyqx,
                        //         fcyybqx:that.formField.fcyybqx,
                        //         fcyqtwt:that.formField.fcyqtwt,
                        //         fzhjl:that.formField.fzhjl,
                        //         fzhjg:that.formField.fzhjg,
                        //         fzhbgqtwt:that.formField.fzhbgqtwt,
                        //         fpdbh:that.formField.fpdbh,
                        //         fyshbh:that.formField.fyshbh,
                        //     }
                        // }
                        // editServe(data).then(res=>{
                        //     if(res.code == 200){
                        //         that.successReturn(false)
                        //         that.$message.success(res.message)
                        //     }else{
                        //         that.$message.warning(res.message)
                        //     }
                        // })
                        that.segmentSubmitClick(1,true)
                        canHandle = true
                    }else{
                        for(let key in err){
                            that.$message.warning(err[key].errors[0].message)
                            return false
                        }
                        
                    }
                })
                return canHandle
            }
        },
        linkHandling(val){
            let result = this.segmentSubmitClick(2)
            if(result){
                this.$refs.processingConditionsAllRef.processingConditionsVisible = true
                let data = {
                    interface:val,
                    sqsxid:this.addEditParameter.sqsxid,
                    nextNodeDbrList:this.addEditParameter.nextNodeDbrList,
                    nextNode:this.addEditParameter.nextNode,
                    jobid:this.addEditParameter.jobid,
                    headerLeftTitle:'办理',
                    isBlr:false,
                    headerCenterTitle:'药品流通查验--综合评定',
                }
                this.processingData = data
                this.$refs.processingConditionsAllRef.getData(data)
            }
        },
        returnPreviousLink(val){
            this.segmentSubmitClick(1,true)
            this.$refs.processingConditionsAllRef.processingConditionsVisible = true
            let data = {
                interface:val,
                sqsxid:this.addEditParameter.sqsxid,
                nextNodeDbrList:this.addEditParameter.nextNodeDbrList,
                nextNode:this.addEditParameter.nextNode,
                jobid:this.addEditParameter.jobid,
                isBlr:false,
                isThhj:true,
                isXyb:false,
                headerLeftTitle:'退回',
                headerCenterTitle:'药品流通查验--综合评定',
            }
            this.processingData = data
            this.$refs.processingConditionsAllRef.getData(data)
        },
        interfaceSuccessful(){
            this.successReturn(false)
        },
        rectificationClick(val){
            this.$refs.supplementaryRectificationRef.visible = true
            this.$refs.supplementaryRectificationRef.getData(
                {interfaceValue:val,modalTitle:'企业整改',jobid:this.addEditParameter.jobid,isTextMessage:true,fsqsxid:this.addEditParameter.sqsxid,isTime:true},
                {opinion:'fzgyj',timeLimit:'fzgsx'}
            )
        },
        historyListClick(val){
            this.$refs.supplementaryHistoryRef.visible = true
            this.$refs.supplementaryHistoryRef.getData({interfaceValue:val,modalTitle:'企业整改历史',sqsxid:this.addEditParameter.sqsxid})
        },
        rectificationSuccess(){

        },
    }

}

</script>
<style lang="less">
/* .ant-form-item-label{
    font-weight: 600;
} */

 .ant-modal-title{
    font-weight: 600;
 }
 .ant-modal-header{
    background: #5ca3e5;
 }
 .ant-modal-footer .ant-btn-primary{
    border: 1px solid #5ca3e5 !important;
    background-color: #5ca3e5 !important;
    color: #fff !important;
 }
 .scheme-modal .ant-modal-header{
    display: none !important;
 }
 .scheme-modal .ant-modal-footer{
    display: none !important;
 }
 .scheme-modal .ant-modal-content{
    height: 100vh;
    overflow: auto;
 }
 .full-modal {
  .ant-modal {
    max-width: 100%;
    top: 0;
    padding-bottom: 0;
    margin: 0;
  }
  .ant-modal-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    height: calc(100vh);
  }
  .ant-modal-body {
    flex: 1;
  }
}
.scheme-modal{
    // .ant-collapse{
    //     background-color: #ded1de !important;
    //     border:1px solid #ded1de !important;
    //     border-bottom: 0 !important;
    // }
    .ant-collapse-header{
        // color: #fff !important;
    }
}
.label-box-w{
    .ant-form-item-label{
        width: 142px;
    }
}
</style>